package com.example.springbootdemo;

import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
public class ThreadDemo01 extends Thread {
    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName() + "<run>");
    }

    public static void main(String[] args) {
        System.out.println("主线程："+Thread.currentThread().getName());
        // 创建一个线程
        ThreadDemo01 threadDemo01 = new ThreadDemo01();
        // 启动线程是start方法而不是run方法
        threadDemo01.start();
    }
}